org.eclipse.vtp.framework.engine.http
Class HttpConnector

java.lang.Object
  extended by org.eclipse.vtp.framework.engine.http.HttpConnector

public class HttpConnector
extends java.lang.Object

The HTTP connection strategy.

Author:
Lonnie Pryor

Field Summary
static java.lang.String ABORT_PATH
          The path info for aborting a session.
static java.lang.String INDEX_PATH
          The path info prefix for the deployment index.
static java.lang.String NEXT_PATH
          The path info for the next step in a session.
static java.lang.String PATH_PREFIX
          The path prefix for reserved commands.
static java.lang.String RESOURCES_PATH
          The path info for binary resources.
 
Constructor Summary
HttpConnector(org.osgi.service.log.LogService log, IProcessEngine engine, org.osgi.service.http.HttpService httpService, IReporter reporter)
          Creates a new HttpConnector.
 
Method Summary
 void configure(java.util.Dictionary properties)
          Configures the basic properties of this connector.
 void deploy(java.lang.String key, java.util.Dictionary properties)
          Deploys a process into the engine.
 java.lang.String getMimeType(java.lang.String resourcePath)
          The MIME type for the specified resource.
 java.net.URL getResource(java.lang.String resourcePath)
          Returns the resource at the specified path.
 void process(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Processes an HTTP request.
 void registerDefinition(java.lang.String definitionID, IProcessDefinition definition, org.osgi.framework.Bundle contributor)
          Registers a process definition with this connector.
 void registerResouces(java.lang.String resourcesID, ResourceGroup resources)
          Registers a resource group with this connector.
 void releaseDefinition(java.lang.String definitionID)
          Releases a process definition in this connector.
 void releaseResouces(java.lang.String resourcesID)
          Releases a resource group in this connector.
 void undeploy(java.lang.String key)
          Undeploys a process from the engine.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PATH_PREFIX

public static final java.lang.String PATH_PREFIX
The path prefix for reserved commands.

See Also:
Constant Field Values

ABORT_PATH

public static final java.lang.String ABORT_PATH
The path info for aborting a session.

See Also:
Constant Field Values

INDEX_PATH

public static final java.lang.String INDEX_PATH
The path info prefix for the deployment index.

See Also:
Constant Field Values

NEXT_PATH

public static final java.lang.String NEXT_PATH
The path info for the next step in a session.

See Also:
Constant Field Values

RESOURCES_PATH

public static final java.lang.String RESOURCES_PATH
The path info for binary resources.

See Also:
Constant Field Values
Constructor Detail

HttpConnector

public HttpConnector(org.osgi.service.log.LogService log,
                     IProcessEngine engine,
                     org.osgi.service.http.HttpService httpService,
                     IReporter reporter)
Creates a new HttpConnector.

Parameters:
engine - The process engine to use.
httpService - The HTTP service to use.
Method Detail

registerDefinition

public void registerDefinition(java.lang.String definitionID,
                               IProcessDefinition definition,
                               org.osgi.framework.Bundle contributor)
Registers a process definition with this connector.

Parameters:
definitionID - The ID of the definition to register.
definition - The definition to register.

releaseDefinition

public void releaseDefinition(java.lang.String definitionID)
Releases a process definition in this connector.

Parameters:
definitionID - The ID of the definition to release.

registerResouces

public void registerResouces(java.lang.String resourcesID,
                             ResourceGroup resources)
Registers a resource group with this connector.

Parameters:
resourcesID - The ID of the resource group to register.
resources - The resource group to register.

releaseResouces

public void releaseResouces(java.lang.String resourcesID)
Releases a resource group in this connector.

Parameters:
resourcesID - The ID of the resource group to release.

configure

public void configure(java.util.Dictionary properties)
Configures the basic properties of this connector.

Parameters:
properties - The basic configuration properties.

deploy

public void deploy(java.lang.String key,
                   java.util.Dictionary properties)
Deploys a process into the engine.

Parameters:
key - The key for the deployment.
properties - The properties of the deployment.

undeploy

public void undeploy(java.lang.String key)
Undeploys a process from the engine.

Parameters:
key - The key for the deployment.

process

public void process(javax.servlet.http.HttpServletRequest req,
                    javax.servlet.http.HttpServletResponse res)
             throws javax.servlet.ServletException,
                    java.io.IOException
Processes an HTTP request.

Parameters:
req - The HTTP request.
res - The HTTP response.
Throws:
javax.servlet.ServletException - If the processing fails.
java.io.IOException - If the connection fails.

getMimeType

public java.lang.String getMimeType(java.lang.String resourcePath)
The MIME type for the specified resource.

Parameters:
resourcePath - The resource to determine the MIME type of.
Returns:
The MIME type for the specified resource.

getResource

public java.net.URL getResource(java.lang.String resourcePath)
Returns the resource at the specified path.

Parameters:
resourcePath - The path of the resource to return.
Returns:
The resource at the specified path.